/*

* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Smart-Shop开源商城系统/ Java商城-首选电商平台系统 请务必保留此注释头信息
* |     开源地址: https://gitee.com/ningbo-qishan/gruul-mall
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     可正常分享和学习源码,未经授权 不可商用！
* |     商业版中台购买/开源版商业授权 联系技术客服
* |     官网:  https://www.73app.cn/
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Copyright (c) 2016-2999 宁波启山智软科技有限公司
* |     版权所有 ,侵权必究！
* ------------------------------------------------------------------------

*/
package com.medusa.gruul.integral.web.model.dto.manager;

import cn.hutool.core.bean.BeanUtil;
import com.medusa.gruul.integral.api.entity.IntegralOrder;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;


/**
 * @Description: 积分订单dto (积分商品)
 * @Author: xiaoq
 * @Date : 2019/12/2 10:26
 */
@Data
@ApiModel(value = "创建订单dto")
public class IntegralOrderDto {
	private Long prizeOrderId;

	@ApiModelProperty(value = "积分商品id")
	private Long prizeId;

	@ApiModelProperty(value = "优惠券id")
	private Long couponId;

	@ApiModelProperty(value = "用户id")
	private String userId;

	@ApiModelProperty(value = "支付类型 0为微信支付 1为余额支付 2支付宝支付")
	private Integer payType;

	@ApiModelProperty(value = "订单类型（0为积分商品 1为积分优惠卷）")
	private Boolean orderType;

	@ApiModelProperty(value = "积分商品实际积分")
	@Min(0)
	@NotNull
	private BigDecimal price;

	@ApiModelProperty(value = "积分商品图片(下单时)")
	private String integralGoodsPic;

	@ApiModelProperty(value = "发货消息订阅")
	private String deliveryTemplateId;

	@ApiModelProperty(value = "收货人姓名")
	private String receiverName;

	@ApiModelProperty(value = "省级code")
	private String provinceCode;

	@ApiModelProperty(value = "市级code")
	private String cityCode;

	@ApiModelProperty(value = "区级code")
	private String areaCode;

	@ApiModelProperty(value = "收货地址")
	private String address;

	@ApiModelProperty(value = "收货人电话")
	private String telPhone;

	@ApiModelProperty(value = "邮费")
	@Min(0)
	private BigDecimal shippingFee;

	@ApiModelProperty(value = "买家留言")
	private String buyersNote;

	public IntegralOrder coverIntegralOrder() {
		IntegralOrder integralOrder = new IntegralOrder();
		BeanUtil.copyProperties(this, integralOrder);
		return integralOrder;
	}
}
